package cn.iocoder.yudao.module.system.dal.mysql.userdetail;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.userdetail.UserDetailDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.userdetail.vo.*;

/**
 * 艾灸师详情 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface UserDetailMapper extends BaseMapperX<UserDetailDO> {

    default PageResult<UserDetailDO> selectPage(UserDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserDetailDO>()
                .eqIfPresent(UserDetailDO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserDetailDO::getMobile, reqVO.getMobile())
                .betweenIfPresent(UserDetailDO::getLearnTime, reqVO.getLearnTime())
                .likeIfPresent(UserDetailDO::getRealName, reqVO.getRealName())
                .eqIfPresent(UserDetailDO::getIdNumber, reqVO.getIdNumber())
                .betweenIfPresent(UserDetailDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserDetailDO::getId));
    }

    default List<UserDetailDO> selectList(UserDetailExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<UserDetailDO>()
                .eqIfPresent(UserDetailDO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserDetailDO::getMobile, reqVO.getMobile())
                .betweenIfPresent(UserDetailDO::getLearnTime, reqVO.getLearnTime())
                .likeIfPresent(UserDetailDO::getRealName, reqVO.getRealName())
                .eqIfPresent(UserDetailDO::getIdNumber, reqVO.getIdNumber())
                .betweenIfPresent(UserDetailDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserDetailDO::getId));
    }

}
